package com.kuaidi100.sdk.response;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 短信回调结果
 *
 * @Author: api.kuaidi100.com
 * @Date: 2020-07-21 10:02
 */
public class SmsCallbackResp {
    /**
     * 状态值：0-表示失败；1-表示成功
     */
    private Integer status;
    /**
     * 返回数据信息：短信发送状态
     */
    private SmsCallbackData data;
    /**
     * 信息内容：返回具体的信息体描述
     */
    private String msg;
    /**
     * 附加信息
     */
    private String extra;
    /**
     * 该值表示所数据的总条数
     */
    private Integer total;

    @Override
    public String toString() {
        try {
            ObjectMapper objectMapper = new ObjectMapper();
            return objectMapper.writeValueAsString(this);
        } catch (Exception e) {
            return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                    .append("status", status)
                    .append("data", data)
                    .append("msg", msg)
                    .append("extra", extra)
                    .append("total", total)
                    .toString();
        }
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public SmsCallbackData getData() {
        return data;
    }

    public void setData(SmsCallbackData data) {
        this.data = data;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public String getExtra() {
        return extra;
    }

    public void setExtra(String extra) {
        this.extra = extra;
    }

    public Integer getTotal() {
        return total;
    }

    public void setTotal(Integer total) {
        this.total = total;
    }
}
